<?php
/************************FoxPHP威客系统************************/
/*                                                            */
/*  FoxPHP.Com (C)2006-2016 FoxPHP Inc.                       */
/*  This is NOT a freeware, use is subject to license terms   */
/*  FoxPHP威客系统是商业软件,使用于商业用途请购买授权         */
/*  V3.0 2016.3                                               */
/*  foxphp@aliyun.com                                         */
/*  http://www.foxphp.com                                     */
/*                                                            */
/**************************************************************/

//发布服务类
namespace Fuwu\Controller;
use Think\Controller;
class PublishController extends \Member\Controller\IndexController {
	
	public function CheckTask(){
		$id=intval($_GET['id']);
		$this->assign('id',$id);
		$this->assign('uploadid','sid'); //设置上传文件任务字段
		
		if($id){
			$data=new \Data\Model\DataModel();
			$manage=$data->GetData($id,$this->uid);
			if(empty($manage['id'])){
				$this->error($data->getError());
				return false;
			}
			
			$this->assign('manage',$manage);
		}
		
		return $id;
	}
	
	//第一步
	public function indexAction(){
		$this->CheckTask();
		
		$shopmodel=new \Member\Model\ShopCertificateModel();
		$certificate=$shopmodel->GetCertificate($this->uid);
		if(intval($certificate['status'])!=5){
			$this->error('对不起，请开店后操作！','/seller/shop',3);
			exit();
		}
		
		$model=new \Category\Model\CategoryModel();
		$categoryarr=$model->GetTaskCategory();
		$this->assign('categoryarr',$categoryarr);
		
		$uploadsize=round(C('onefileuploadsize')/1024/1024,2);
		$this->assign('uploadsize',$uploadsize);
		
		$this->assign('PATH',array('发布服务'));
		$this->assign('SEO',array('title'=>'发布服务','keywords'=>'发布服务','description'=>'发布服务'));
		
		$this->display();
	}
	
}